Source for file SC_PageNavi.php
Documentation is available at SC_PageNavi.php
* This file is part of EC-CUBE
* Copyright(c) 2000-2010 LOCKON CO.,LTD. All Rights Reserved.
* http://www.lockon.co.jp/
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
<input type="hidden" name="pageno" value="<!--{$tpl_pageno}-->">
$objPage->tpl_pageno = $_POST['pageno'];
・$func_nameに指定するJavaScriptの例
function fnNaviPage(pageno) {
document.form1['pageno'].value = pageno;
function SC_PageNavi($now_page, $all_row, $page_row, $func_name, $navi_max = NAVI_PMAX) {
//現在ページ($now_page)が正しい数値でない場合
if (!eregi("^[[:digit:]]+$", $now_page) || $now_page < 1 || $now_page == "") {
// 最終ページよりも現在ページが大きい場合は、最初に戻す。
$before= "<a href=\"". $ps . "\" onclick=\"$func_name('" . (($this->now_page) - 1) . "'); return false;\"><<前へ</a> ";
$next= " <a href=\"". $ps . "\" onclick=\"$func_name('" . (($this->now_page) + 1) . "'); return false;\">次へ>></a>";
if($navi_max == "" || $navi_max > $this->max_page) {
// 制限ナビ数の指定がない。ページ最大数が制限ナビ数より少ない。
$disp_max = $this->now_page + $navi_max - 1;
// ページ最大数を超えている場合は、ページ最大数に合わせる。
if($navi_max == "" || $navi_max > $this->now_page) {
// 制限ナビ数の指定がない。現在ページ番号が制限ナビ数より少ない。
$disp_min = $this->now_page - $navi_max + 1;
for ($i= $disp_min; $i <= $disp_max; $i++ ) {
$page_number .= "<strong>$i</strong>";
$page_number.= "<a href=\"". $ps . "\" onclick=\"$func_name('$i'); return false;\">$i</a>";
$this->strnavi = $before . $page_number . $next;
Documentation generated on Fri, 24 Feb 2012 14:00:19 +0900 by Seasoft
|